<template>
  <div>
    <div style="height:80px">
      <el-form :inline="true" class="demo-form-inline">
      <el-form-item>
        <el-input v-model="map.findid" placeholder="指标编码"></el-input>
      </el-form-item>
      <el-form-item>
        <el-input v-model="map.findname" placeholder="指标名称"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="selquotaall()">查询</el-button>
      </el-form-item>
    </el-form>
    </div>
    <div>
      <el-table
      :data="page.rows"
      border
      style="width: 100%">
      <el-table-column
        prop="quotaId"
        label="指标编号"
        width="300"
        align="center">
      </el-table-column>
      <el-table-column
        prop="quotaName"
        label="指标名称"
        width="328"
        align="center">
      </el-table-column>
      <el-table-column
        prop="quotaConsult"
        label="指标数值"
        width="300"
        align="center">
      </el-table-column>
      <el-table-column
        prop="quotaUnit"
        label="指标单位"
        width="300"
        align="center">
      </el-table-column>
    </el-table>
    </div>
    <div class="block">
      <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[3, 5, 9, 15]"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="page.total">
        </el-pagination>
    </div>
  </div>
</template>

<script>
import axios from 'axios'

export default ({
  name: 'quota',
  data () {
    return {
      map: {
        index: '',
        findid: '',
        findname: ''
      },
      page: {},
      currentPage: 1,
      pageSize: 5
    }
  },
  methods: {
    // 改变页大小
    handleSizeChange (value) {
      this.pageSize = value
      this.selquotaall()
    },
    // 改变当前页码
    handleCurrentChange (value) {
      this.currentPage = value
      this.selquotaall()
    },
    selquotaall () {
      this.map.index = this.currentPage
      this.map.pageSize = this.pageSize
      axios.post('/api/quota/selquotaall', this.map).then(result => {
        this.page = result.data
      })
    }
  },
  created () {
    this.selquotaall()
  }
})
</script>

<style scoped>

</style>
